
# Compiler
CC = arm-nextvpu-linux-gnueabihf-gcc

# Compiler flags
CFLAGS = -Wall -Wextra -Werror -Iinc
LDFLAGS = -L./lib -Wl,-rpath=./lib -lcjson

# Source files directory
SRCDIR = src

# Header files directory
#INCDIR = inc

# Source files
SRCS = $(wildcard $(SRCDIR)/*.c)

# Header files
#HDRS = $(wildcard $(INCDIR)/*.h)

# Object files
OBJS = $(SRCS:$(SRCDIR)/%.c=%.o)

# Executable
TARGET = json

# Build executable
$(TARGET): $(OBJS)
	$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LDFLAGS)

# Compile source files
%.o: $(SRCDIR)/%.c $(HDRS)
	$(CC) $(CFLAGS) -c $< -o $@

# Clean
clean:
	rm -f $(OBJS) $(TARGET)

